/**
 * 
 */
import lejos.nxt.*;
import lejos.robotics.subsumption.*;

/**
 * @author ROB
 *
 */
public class ArmBehavior {

//This is for the first motor of the arm	
public class ArmMotorA implements Behavior{
	private boolean suppressed;
	
	public void suppress(){
		suppressed = true;
	}
	public boolean takeControl(){
		return true;
	}
	public void action(){
		suppressed = false;
		Motor.A.forward();
		   while(!suppressed){
		  	Thread.yield();
		  	Motor.A.stop();
		   }
	}
}
public class ArmMotorB implements Behavior{
	
	private boolean suppressed;
	@Override
	public void action() {
		suppressed = false;
		Motor.B.forward();
		while(!suppressed){
			Thread.yield();
		}
	}
	@Override
	public void suppress() {
		suppressed = true;
	}
	@Override
	public boolean takeControl() {
		return false;
	}
}	
public class ArmMotorC implements Behavior{
	private boolean suppressed;
	private UltrasonicSensor sensor;

	@Override
	public void action() {
			
	}

	@Override
	public void suppress() {
		suppressed = true;
	}	 	

	@Override
	public boolean takeControl() {
	return sensor.getDistance() > 50;
	}
}
}

